function [f,g] = UfunObj(x, p, C)
f = 0.5*sum(x(1:p).^2) + C*sum(x(p+1:end));
g = x;
g(p+1:end) = C;
end